package com.definesys.smecrailtransit.SmecManager.SmecAnimation;

import android.animation.ValueAnimator;
import android.view.animation.AlphaAnimation;

/**
 * Created by xupeizuo on 2017/8/4.
 */

public class SmecAnimation {

    /**
     * 渐变动画 -补间动画
     * @param fromAlpha
     * @param toAlpha
     * @param durationMillis
     * @return
     */
    public static AlphaAnimation showAlphaAnimation(float fromAlpha, float toAlpha, long durationMillis){
        AlphaAnimation alphaAnimation=new AlphaAnimation(fromAlpha,toAlpha);
        alphaAnimation.setDuration(durationMillis);
        alphaAnimation.setFillAfter(true);
        return alphaAnimation;
    }

    /**
     * 伸缩动画 -属性动画
     * @param from
     * @param to
     * @param durationMillis
     * @return
     */
    public static ValueAnimator showValueAnimator(int from, int to, long durationMillis){
        ValueAnimator valueAnimator=ValueAnimator.ofInt(to);
        valueAnimator.setDuration(durationMillis);
        return valueAnimator;
    }

}
